package com.baizw.cultivation.module.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 资源实体
 *
 * @author 剧终1204
 * @version V1.0
 * @date 2020年04月27日 11:02:30
 */
@Data
@ApiModel("资源实体")
@TableName("t_resource")
@EqualsAndHashCode(callSuper = true)
public class ResourceEntity extends BaseEntity implements Serializable {

    @TableField("`name`")
    @ApiModelProperty("资源名称")
    private String name;

    @ApiModelProperty("组件名称")
    private String component;

    @ApiModelProperty("图标")
    private String icon;

    @ApiModelProperty("路由")
    private String path;

    @ApiModelProperty("转发路由")
    private String redirect;

    @ApiModelProperty("标题")
    private String title;

    @TableField("`show`")
    @ApiModelProperty("是否显示")
    private Boolean show;

    @ApiModelProperty("是否缓存")
    private Boolean keepAlive;

    @ApiModelProperty("是否是外链【'_blank'】")
    private String target;

    @ApiModelProperty("权限采用二进制存储【00000000】")
    private String permission;

    @ApiModelProperty("父级ID")
    private Long parentId;

    @ApiModelProperty("排序")
    private Integer sort;

    @TableField(exist = false)
    private List<ResourceEntity> children;

    @TableField(exist = false)
    private List<Map<String, Object>> actionData;

    @TableField(exist = false)
    private List<String> actions;
}
